/*   1:    */ package org.jetbrains.jps.model.java.impl.compiler;
/*   2:    */ 
/*   3:    */

import gnu.trove.THashMap;
import gnu.trove.THashSet;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jps.model.java.compiler.ProcessorConfigProfile;

import java.util.Collection;
import java.util.Collections;
import java.util.Map;
import java.util.Set;

/*   4:    */
/*   5:    */
/*   6:    */
/*   7:    */
/*   8:    */
/*   9:    */
/*  10:    */
/*  11:    */
/*  12:    */ 
/*  13:    */ public final class ProcessorConfigProfileImpl
/*  14:    */   implements ProcessorConfigProfile
/*  15:    */ {
/*  16: 35 */   private String a = "";
/*  17: 36 */   private boolean b = false;
/*  18: 37 */   private boolean c = true;
/*  19: 38 */   private String d = "";
/*  20: 39 */   private final Set<String> e = new THashSet(1);
/*  21: 40 */   private final Map<String, String> f = new THashMap(1);
/*  22: 41 */   private String g = "generated";
/*  23: 42 */   private String h = "generated_tests";
/*  24: 43 */   private boolean i = false;
/*  25: 45 */   private final Set<String> j = new THashSet(1);
/*  26:    */   
/*  27:    */   public ProcessorConfigProfileImpl(String paramString)
/*  28:    */   {
/*  29: 48 */     this.a = paramString;
/*  30:    */   }
/*  31:    */   
/*  32:    */   public ProcessorConfigProfileImpl(ProcessorConfigProfile paramProcessorConfigProfile)
/*  33:    */   {
/*  34: 52 */     initFrom(paramProcessorConfigProfile);
/*  35:    */   }
/*  36:    */   
/*  37:    */   public final void initFrom(ProcessorConfigProfile paramProcessorConfigProfile)
/*  38:    */   {
/*  39: 57 */     this.a = paramProcessorConfigProfile.getName();
/*  40: 58 */     this.b = paramProcessorConfigProfile.isEnabled();
/*  41: 59 */     this.c = paramProcessorConfigProfile.isObtainProcessorsFromClasspath();
/*  42: 60 */     this.d = paramProcessorConfigProfile.getProcessorPath();
/*  43: 61 */     this.e.clear();
/*  44: 62 */     this.e.addAll(paramProcessorConfigProfile.getProcessors());
/*  45: 63 */     this.f.clear();
/*  46: 64 */     this.f.putAll(paramProcessorConfigProfile.getProcessorOptions());
/*  47: 65 */     this.g = paramProcessorConfigProfile.getGeneratedSourcesDirectoryName(false);
/*  48: 66 */     this.h = paramProcessorConfigProfile.getGeneratedSourcesDirectoryName(true);
/*  49: 67 */     this.i = paramProcessorConfigProfile.isOutputRelativeToContentRoot();
/*  50: 68 */     this.j.clear();
/*  51: 69 */     this.j.addAll(paramProcessorConfigProfile.getModuleNames());
/*  52:    */   }
/*  53:    */   
/*  54:    */   public String getName()
/*  55:    */   {
/*  56: 74 */     return this.a;
/*  57:    */   }
/*  58:    */   
/*  59:    */   public void setName(String paramString)
/*  60:    */   {
/*  61: 79 */     this.a = paramString;
/*  62:    */   }
/*  63:    */   
/*  64:    */   public boolean isEnabled()
/*  65:    */   {
/*  66: 84 */     return this.b;
/*  67:    */   }
/*  68:    */   
/*  69:    */   public void setEnabled(boolean paramBoolean)
/*  70:    */   {
/*  71: 89 */     this.b = paramBoolean;
/*  72:    */   }
/*  73:    */   
/*  74:    */   @NotNull
/*  75:    */   public String getProcessorPath()
/*  76:    */   {
/*  77: 95 */     String tmp4_1 = this.d;
/*  78: 95 */     if (tmp4_1 == null) {
/*  79: 95 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/java/impl/compiler/ProcessorConfigProfileImpl", "getProcessorPath" }));
/*  80:    */     }
/*  81: 95 */     return tmp4_1;
/*  82:    */   }
/*  83:    */   
/*  84:    */   public void setProcessorPath(@Nullable String paramString)
/*  85:    */   {
/*  86:100 */     this.d = (paramString != null ? paramString : "");
/*  87:    */   }
/*  88:    */   
/*  89:    */   public boolean isObtainProcessorsFromClasspath()
/*  90:    */   {
/*  91:105 */     return this.c;
/*  92:    */   }
/*  93:    */   
/*  94:    */   public void setObtainProcessorsFromClasspath(boolean paramBoolean)
/*  95:    */   {
/*  96:110 */     this.c = paramBoolean;
/*  97:    */   }
/*  98:    */   
/*  99:    */   @NotNull
/* 100:    */   public String getGeneratedSourcesDirectoryName(boolean paramBoolean)
/* 101:    */   {
/* 102:116 */     String tmp15_12 = (paramBoolean ? this.h : this.g);
/* 103:116 */     if (tmp15_12 == null) {
/* 104:116 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/java/impl/compiler/ProcessorConfigProfileImpl", "getGeneratedSourcesDirectoryName" }));
/* 105:    */     }
/* 106:116 */     return tmp15_12;
/* 107:    */   }
/* 108:    */   
/* 109:    */   public void setGeneratedSourcesDirectoryName(@Nullable String paramString, boolean paramBoolean)
/* 110:    */   {
/* 111:121 */     if (paramBoolean) {
/* 112:122 */       this.h = (paramString != null ? paramString.trim() : "generated_tests");
/* 113:    */     } else {
/* 114:125 */       this.g = (paramString != null ? paramString.trim() : "generated");
/* 115:    */     }
/* 116:    */   }
/* 117:    */   
/* 118:    */   public boolean isOutputRelativeToContentRoot()
/* 119:    */   {
/* 120:131 */     return this.i;
/* 121:    */   }
/* 122:    */   
/* 123:    */   public void setOutputRelativeToContentRoot(boolean paramBoolean)
/* 124:    */   {
/* 125:136 */     this.i = paramBoolean;
/* 126:    */   }
/* 127:    */   
/* 128:    */   @NotNull
/* 129:    */   public Set<String> getModuleNames()
/* 130:    */   {
/* 131:142 */     Set tmp4_1 = this.j;
/* 132:142 */     if (tmp4_1 == null) {
/* 133:142 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/java/impl/compiler/ProcessorConfigProfileImpl", "getModuleNames" }));
/* 134:    */     }
/* 135:142 */     return tmp4_1;
/* 136:    */   }
/* 137:    */   
/* 138:    */   public boolean addModuleName(String paramString)
/* 139:    */   {
/* 140:147 */     return this.j.add(paramString);
/* 141:    */   }
/* 142:    */   
/* 143:    */   public boolean addModuleNames(Collection<String> paramCollection)
/* 144:    */   {
/* 145:152 */     return this.j.addAll(paramCollection);
/* 146:    */   }
/* 147:    */   
/* 148:    */   public boolean removeModuleName(String paramString)
/* 149:    */   {
/* 150:157 */     return this.j.remove(paramString);
/* 151:    */   }
/* 152:    */   
/* 153:    */   public boolean removeModuleNames(Collection<String> paramCollection)
/* 154:    */   {
/* 155:162 */     return this.j.removeAll(paramCollection);
/* 156:    */   }
/* 157:    */   
/* 158:    */   public void clearModuleNames()
/* 159:    */   {
/* 160:167 */     this.j.clear();
/* 161:    */   }
/* 162:    */   
/* 163:    */   public void clearProcessors()
/* 164:    */   {
/* 165:172 */     this.e.clear();
/* 166:    */   }
/* 167:    */   
/* 168:    */   public boolean addProcessor(String paramString)
/* 169:    */   {
/* 170:177 */     return this.e.add(paramString);
/* 171:    */   }
/* 172:    */   
/* 173:    */   public boolean removeProcessor(String paramString)
/* 174:    */   {
/* 175:182 */     return this.e.remove(paramString);
/* 176:    */   }
/* 177:    */   
/* 178:    */   @NotNull
/* 179:    */   public Set<String> getProcessors()
/* 180:    */   {
/* 181:188 */     Set tmp7_4 = Collections.unmodifiableSet(this.e);
/* 182:188 */     if (tmp7_4 == null) {
/* 183:188 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/java/impl/compiler/ProcessorConfigProfileImpl", "getProcessors" }));
/* 184:    */     }
/* 185:188 */     return tmp7_4;
/* 186:    */   }
/* 187:    */   
/* 188:    */   @NotNull
/* 189:    */   public Map<String, String> getProcessorOptions()
/* 190:    */   {
/* 191:194 */     Map tmp7_4 = Collections.unmodifiableMap(this.f);
/* 192:194 */     if (tmp7_4 == null) {
/* 193:194 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/java/impl/compiler/ProcessorConfigProfileImpl", "getProcessorOptions" }));
/* 194:    */     }
/* 195:194 */     return tmp7_4;
/* 196:    */   }
/* 197:    */   
/* 198:    */   public String setOption(String paramString1, String paramString2)
/* 199:    */   {
/* 200:199 */     return (String)this.f.put(paramString1, paramString2);
/* 201:    */   }
/* 202:    */   
/* 203:    */   @Nullable
/* 204:    */   public String getOption(String paramString)
/* 205:    */   {
/* 206:205 */     return (String)this.f.get(paramString);
/* 207:    */   }
/* 208:    */   
/* 209:    */   public void clearProcessorOptions()
/* 210:    */   {
/* 211:210 */     this.f.clear();
/* 212:    */   }
/* 213:    */   
/* 214:    */   public boolean equals(Object paramObject)
/* 215:    */   {
/* 216:215 */     if (this == paramObject) {
/* 217:215 */       return true;
/* 218:    */     }
/* 219:216 */     if ((paramObject == null) || (getClass() != paramObject.getClass())) {
/* 220:216 */       return false;
/* 221:    */     }
/* 222:218 */     ProcessorConfigProfileImpl localProcessorConfigProfileImpl = (ProcessorConfigProfileImpl)paramObject;
/* 223:220 */     if (this.b != localProcessorConfigProfileImpl.b) {
/* 224:220 */       return false;
/* 225:    */     }
/* 226:221 */     if (this.c != localProcessorConfigProfileImpl.c) {
/* 227:221 */       return false;
/* 228:    */     }
/* 229:222 */     if (this.g != null ? !this.g.equals(localProcessorConfigProfileImpl.g) : localProcessorConfigProfileImpl.g != null) {
/* 230:225 */       return false;
/* 231:    */     }
/* 232:227 */     if (this.h != null ? !this.h.equals(localProcessorConfigProfileImpl.h) : localProcessorConfigProfileImpl.h != null) {
/* 233:230 */       return false;
/* 234:    */     }
/* 235:232 */     if (this.i != localProcessorConfigProfileImpl.i) {
/* 236:232 */       return false;
/* 237:    */     }
/* 238:233 */     if (!this.j.equals(localProcessorConfigProfileImpl.j)) {
/* 239:233 */       return false;
/* 240:    */     }
/* 241:234 */     if (!this.f.equals(localProcessorConfigProfileImpl.f)) {
/* 242:234 */       return false;
/* 243:    */     }
/* 244:235 */     if (this.d != null ? !this.d.equals(localProcessorConfigProfileImpl.d) : localProcessorConfigProfileImpl.d != null) {
/* 245:235 */       return false;
/* 246:    */     }
/* 247:236 */     if (!this.e.equals(localProcessorConfigProfileImpl.e)) {
/* 248:236 */       return false;
/* 249:    */     }
/* 250:237 */     if (!this.a.equals(localProcessorConfigProfileImpl.a)) {
/* 251:237 */       return false;
/* 252:    */     }
/* 253:239 */     return true;
/* 254:    */   }
/* 255:    */   
/* 256:    */   public int hashCode()
/* 257:    */   {
/* 258:244 */     int k = this.a.hashCode();
/* 259:245 */     k = 31 * k + (this.b ? 1 : 0);
/* 260:246 */     k = 31 * k + (this.c ? 1 : 0);
/* 261:247 */     k = 31 * k + (this.d != null ? this.d.hashCode() : 0);
/* 262:248 */     k = 31 * k + this.e.hashCode();
/* 263:249 */     k = 31 * k + this.f.hashCode();
/* 264:250 */     k = 31 * k + (this.g != null ? this.g.hashCode() : 0);
/* 265:251 */     k = 31 * k + (this.h != null ? this.h.hashCode() : 0);
/* 266:252 */     k = 31 * k + (this.i ? 1 : 0);
/* 267:253 */     k = 31 * k + this.j.hashCode();
/* 268:254 */     return k;
/* 269:    */   }
/* 270:    */   
/* 271:    */   public String toString()
/* 272:    */   {
/* 273:259 */     return this.a;
/* 274:    */   }
/* 275:    */ }



/* Location:           E:\idea\

 * Qualified Name:     org.jetbrains.jps.model.java.impl.compiler.ProcessorConfigProfileImpl

 * JD-Core Version:    0.7.0.1

 */